package org.leetcode.middle.leetcode153;

public class Solution2 {
    public int findMin(int[] nums) {

        int n = nums.length;

        int left = 0;
        int right = n-1;

        while (left<=right){
            int mid =(left+right)>>>1;
            if (nums[mid]>nums[right]){
                left=mid+1;
            }else {
                right=mid-1;
            }
        }

        return left;
    }
}
